﻿using System;
using System.Runtime.InteropServices;

namespace QuotationService.RealtimeQuotation
{
    /// <summary>
    /// 分线数据
    /// </summary>
    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
    internal struct OptionMinuteData
    {
        /// <summary>
        /// 商品代码
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MarshalSizeConsts.CodeLength)]
        public string Code;

        /// <summary>
        /// 分线时间（分钟，格式HHMM）
        /// </summary>
        public Int32 OccurTime;

        /// <summary>
        /// 开盘价
        /// </summary>
        public double OpenPrice;

        /// <summary>
        /// 最高成交价
        /// </summary>
        public double HighPrice;

        /// <summary>
        /// 最低成交价
        /// </summary>
        public double LowPrice;

        /// <summary>
        /// 收盘价
        /// </summary>
        public double ClosePrice;

        /// <summary>
        /// 总量
        /// </summary>
        public Int64 KnockQty;

        /// <summary>
        /// 成交金额
        /// </summary>
        public double KnockAmt;

        /// <summary>
        /// 当前持仓
        /// </summary>
        public Int64 OpenPosition;

        /// <summary>
        /// 成交均价
        /// </summary>
        public double KnockAvgPrice;

        /// <summary>
        /// Tick序号
        /// </summary>
        public Int32 TickSN;
    }
}
